<?xml version="1.0" encoding="UTF-8"?>    
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:c="http://java.sun.com/jstl/core"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:util="http://java.sun.com/jsf/composite/components/util">
<ui:composition template="/WEB-INF/templates/platTemplate.xhtml">
	<ui:define name="content">
		<h:form id="manageSystemUserForm" prependId="false">
			<a4j:outputPanel id="toolbarPanel" ajaxRendered="true" layout="block" styleClass="toolbar">
				<div class="tdiv firstdiv">
					<a4j:commandLink action="#{manageSystemUserPage.preCreateAction}" value="" event="click" execute="@this" render="mainManageSystemUserPanel" styleClass="btns">
						<f:verbatim>
							<span class="btn_l">&nbsp;</span>
							<span class="btn_txt">#{message['operate.add.display']}</span>
							<span class="btn_r">&nbsp;</span>
						</f:verbatim>
					</a4j:commandLink>
				</div>
			</a4j:outputPanel>
			<div class="normalContent">
				<a4j:outputPanel id="searchPanel" layout="block">
						<div class="add_detail_box">
							<p>
								<span>
								<h:outputLabel value="#{message['system.user.loginname.display'] }" styleClass="normallabel"></h:outputLabel>
								<h:inputText value="#{manageSystemUserPage.page.param.loginName}" styleClass="normal_input_text"><f:ajax event="blur" execute="@this" render="@this"></f:ajax></h:inputText>
								</span>
							</p>
							
								<a4j:commandLink action="#{manageSystemUserPage.searchPageAction}" value="" event="click" execute="@this" render="searchPanel pageDataPanel mainManageSystemUserPanel" styleClass="btn"><f:verbatim><span>#{message['button.search.display'] }</span></f:verbatim></a4j:commandLink>

						</div>
				</a4j:outputPanel>
				<a4j:outputPanel id="pageDataPanel" layout="block">
					<div class="scrollDivGrid">
						<div class="scrollDivGridInner">
					    	<ul id="companyUlHeader" class="headline">
					    		<li style="width:110px"><span>#{message['operate.display'] }</span></li>
							    <li style="width:80px"><span>#{message['system.user.username.display'] }</span></li>
								<li style="width:50px"><span>#{message['system.user.sex.display'] }</span></li>
				       			<li style="width:150px"><span>#{message['system.user.loginname.display'] }</span></li>
				    			<li style="width:150px"><span>#{message['system.user.mobile.display'] }</span></li>
							    <li style="width:150px;"><span>#{message['system.user.phone.display'] }</span></li>
							    <li style="width:200px;"><span>#{message['system.user.email.display'] }</span></li>
							    <li style="width:150px;"><span>#{message['system.user.qicq.display'] }</span></li>
							    <li style="width:150px;"><span>#{message['system.user.msn.display'] }</span></li>
							    <li style="width:50px;"><span>#{message['system.user.status.display'] }</span></li>
							    <li style="width:100px;"><span>#{message['system.user.level.display'] }</span></li>
							    <li style="width:100px" class="last"><span>#{message['system.user.orgid.display'] }</span></li>
							</ul>
							<a4j:repeat value="#{manageSystemUserPage.page.page.result}" var="user" rowKeyVar="rowNo">
								<ul id="userUl#{rowNo}" class="">
									<li style="width:110px">
										<a4j:commandLink action="#{manageSystemUserPage.viewAction }" value="#{message['operate.view.display'] }" event="click" execute="@this" render="pageDataPanel mainManageSystemUserPanel"><f:param name="objId" value="#{user.id }"></f:param></a4j:commandLink>
										<f:verbatim>&nbsp;&nbsp;</f:verbatim>
										<a4j:commandLink action="#{manageSystemUserPage.editAction }" value="#{message['operate.edit.display'] }" event="click" execute="@this" render="pageDataPanel mainManageSystemUserPanel"><f:param name="objId" value="#{user.id }"></f:param></a4j:commandLink>
										<f:verbatim>&nbsp;&nbsp;</f:verbatim>
										
										<a4j:commandLink id="urlink#{rowNo}" action="#{manageSystemUserPage.loadUserRoleAction}" value="#{message['operate.allocate.role.display'] }" event="click" execute="@this" render="userRolePanel" oncomplete="#{rich:component('popup')}.show();">
											<f:param name="objId" value="#{user.id }"></f:param>
											<f:param name="loginName" value="#{user.loginName }"></f:param>
										</a4j:commandLink>
										
									</li>
									<li style="width:80px"><h:outputLabel value="#{user.userName} "></h:outputLabel></li>
								    <li style="width:50px"><util:sexLabel sex="#{user.sex }"></util:sexLabel></li>
								    <li style="width:150px"><h:outputLabel value="#{user.loginName }"></h:outputLabel></li>
								    <li style="width:150px"><h:outputLabel value="#{user.mobile }"></h:outputLabel></li>
								    <li style="width:150px;"><h:outputLabel value="#{user.phone }"></h:outputLabel></li>
								    <li style="width:200px;"><h:outputLabel value="#{user.email }"></h:outputLabel></li>
								    <li style="width:150px;"><h:outputLabel value="#{user.qicq }"></h:outputLabel></li>
								    <li style="width:150px;"><h:outputLabel value="#{user.msn }"></h:outputLabel></li>
								    <li style="width:50px"><util:systemUserStatusLabel status="#{user.status }"></util:systemUserStatusLabel></li>
								    <li style="width:100px"><util:systemUserIdentityLabel indentity="#{user.level }" styleClsss="normallabelintable"></util:systemUserIdentityLabel></li>
								    <li style="width:100px"><util:organizationLabel organizationId="#{user.orgId }"></util:organizationLabel></li>
								    
								    
								   
	
							  	</ul>
						  	</a4j:repeat>
						  	<script language="javascript">
								setUlLastBorder('userUlHeader');
							</script>
						  	<a4j:outputPanel id="emptyDataPanel" rendered="#{empty manageSystemUserPage.page.page.result}" display="block">
						  		<span class="f13 fB">#{msgs['empty.data.display'] }</span>
						  	</a4j:outputPanel>
						</div>
					</div>
					<div id="d_p_list">
						<util:pageNavigation id="systemUserNav" pageData="#{manageSystemUserPage.page.page }" pageNoAction="#{manageSystemUserPage.selectPageNo }" prePageNoId="prePageNoBtnFootHead" prePageNoLabel="#{message['page.navigation.pre.display']}" renderId="pageDataPanel" nextPageNoId="nextPageNoBtnFootHead" nextPageNoLabel="#{message['page.navigation.next.display']}"></util:pageNavigation>
					</div>
				</a4j:outputPanel>
	         	<a4j:outputPanel id="mainManageSystemUserPanel" ajaxRendered="true" layout="block">
					<h:panelGrid columns="2" styleClass="normaltable" headerClass="tleft" columnClasses="percent10 tleft,percent90" rendered="#{'VIEW' eq manageSystemUserPage.action }">
			
						<f:facet name="header">
							<h:outputLabel value="#{message['system.user.info.display'] }" styleClass="f14 fN"></h:outputLabel>
							[<a4j:commandLink action="#{manageSystemUserPage.viewToEditAction }" value="#{message['operate.edit.display'] }" event="click" execute="@this" render="mainManageSystemUserPanel"></a4j:commandLink>]
						</f:facet>
						
						<h:outputLabel value="#{message['system.user.username.display'] }：" styleClass="normallabel"></h:outputLabel>
						<h:outputText value="#{manageSystemUserPage.view.userName }" styleClass="normal_output_text"></h:outputText>
						<h:outputLabel value="#{message['system.user.sex.display'] }：" styleClass="normallabel"></h:outputLabel>
						<h:panelGroup><util:sexLabel sex="#{manageSystemUserPage.view.sex }" styleClass="normal_output_text"></util:sexLabel></h:panelGroup>
						<h:outputLabel value="#{message['system.user.loginname.display'] }：" styleClass="normallabel"></h:outputLabel>
						<h:outputText value="#{manageSystemUserPage.view.loginName }" styleClass="normal_output_text"></h:outputText>
						<h:outputLabel value="#{message['system.user.mobile.display'] }：" styleClass="normallabel"></h:outputLabel>
						<h:outputText value="#{manageSystemUserPage.view.mobile }" styleClass="normal_output_text"></h:outputText>
						<h:outputLabel value="#{message['system.user.phone.display'] }：" styleClass="normallabel"></h:outputLabel>
						<h:outputText value="#{manageSystemUserPage.view.phone }" styleClass="normal_output_text"></h:outputText>
						<h:outputLabel value="#{message['system.user.email.display'] }：" styleClass="normallabel"></h:outputLabel>
						<h:outputText value="#{manageSystemUserPage.view.email }" styleClass="normal_output_text"></h:outputText>
						<h:outputLabel value="#{message['system.user.qicq.display'] }：" styleClass="normallabel"></h:outputLabel>
						<h:outputText value="#{manageSystemUserPage.view.qicq }" styleClass="normal_output_text"></h:outputText>
						<h:outputLabel value="#{message['system.user.msn.display'] }：" styleClass="normallabel"></h:outputLabel>
						<h:outputText value="#{manageSystemUserPage.view.msn }" styleClass="normal_output_text"></h:outputText>
						<h:outputLabel value="#{message['system.user.status.display'] }：" styleClass="normallabel"></h:outputLabel>
						<h:panelGroup><util:systemUserStatusLabel status="#{manageSystemUserPage.view.status }" styleClass="normal_output_text"></util:systemUserStatusLabel></h:panelGroup>
						<h:outputLabel value="#{message['system.user.level.display'] }：" styleClass="normallabel"></h:outputLabel>
						<h:panelGroup><util:systemUserIdentityLabel indentity="#{manageSystemUserPage.view.level }" styleClass="normal_output_text"></util:systemUserIdentityLabel></h:panelGroup>
						<h:outputLabel value="#{message['system.user.orgid.display'] }：" styleClass="normallabel"></h:outputLabel>
						<h:panelGroup><util:organizationLabel organizationId="#{manageSystemUserPage.view.orgId }" styleClass="normal_output_text"></util:organizationLabel></h:panelGroup>
					</h:panelGrid>
					
					<h:panelGrid columns="2" styleClass="normaltable" headerClass="tleft" footerClass="tcenter" columnClasses="percent10 tleft,percent90" rendered="#{('EDIT' eq manageSystemUserPage.action) or ('NEW' eq manageSystemUserPage.action) }">
						
						<f:facet name="header">
							<h:outputLabel value="#{message['system.user.info.display'] }" styleClass="f14 fN"></h:outputLabel>
						</f:facet>
						
						<h:outputLabel value="#{message['system.user.username.display'] }：" styleClass="normallabel"></h:outputLabel>
						<h:inputText value="#{manageSystemUserPage.edit.userName }" maxlength="100" styleClass="normal_input_text"><f:ajax event="blur" execute="@this" render="@this"></f:ajax></h:inputText>
						<h:outputLabel value="#{message['system.user.sex.display'] }：" styleClass="normallabel"></h:outputLabel>
						<h:selectOneMenu value="#{manageSystemUserPage.edit.sex }" styleClass="commonSelectBox">
							<f:selectItems value="#{existSex.items}"/>
							<f:ajax event="valueChange" execute="@this" render="@this"></f:ajax>
						</h:selectOneMenu>
						<h:outputLabel value="#{message['system.user.loginname.display'] }：" styleClass="normallabel"></h:outputLabel>
						<h:panelGroup>
							<h:outputLabel value="#{manageSystemUserPage.edit.loginName }" rendered="#{('EDIT' eq manageSystemUserPage.action) or ('VIEW' eq manageSystemUserPage.action) }" styleClass="normallabel"></h:outputLabel>
							<h:inputText value="#{manageSystemUserPage.edit.loginName }" rendered="#{('NEW' eq manageSystemUserPage.action) }" maxlength="30" styleClass="normal_input_text"><f:ajax event="blur" execute="@this" render="@this"></f:ajax></h:inputText>
						</h:panelGroup>
						
						<h:outputLabel value="#{message['system.user.mobile.display'] }：" styleClass="normallabel"></h:outputLabel>
						<h:inputText value="#{manageSystemUserPage.edit.mobile }" maxlength="100" styleClass="normal_input_text"><f:ajax event="blur" execute="@this" render="@this"></f:ajax></h:inputText>
						<h:outputLabel value="#{message['system.user.phone.display'] }：" styleClass="normallabel"></h:outputLabel>
						<h:inputText value="#{manageSystemUserPage.edit.phone }" maxlength="100" styleClass="normal_input_text"><f:ajax event="blur" execute="@this" render="@this"></f:ajax></h:inputText>
						<h:outputLabel value="#{message['system.user.email.display'] }：" styleClass="normallabel"></h:outputLabel>
						<h:panelGroup id="emailgroup">
							<h:inputText id="email" value="#{manageSystemUserPage.edit.email }" maxlength="100" styleClass="normal_input_text"><f:ajax event="blur" execute="@this" render="emailgroup"></f:ajax></h:inputText>
						</h:panelGroup>
						<h:outputLabel value="#{message['system.user.qicq.display'] }：" styleClass="normallabel"></h:outputLabel>
						<h:inputText value="#{manageSystemUserPage.edit.qicq }" maxlength="100" styleClass="normal_input_text"><f:ajax event="blur" execute="@this" render="@this"></f:ajax></h:inputText>
						<h:outputLabel value="#{message['system.user.msn.display'] }：" styleClass="normallabel"></h:outputLabel>
						<h:inputText value="#{manageSystemUserPage.edit.msn }" maxlength="100" styleClass="normal_input_text"><f:ajax event="blur" execute="@this" render="@this"></f:ajax></h:inputText>
						<h:outputLabel value="#{message['system.user.status.display'] }：" styleClass="normallabel"></h:outputLabel>
						<h:selectOneMenu value="#{manageSystemUserPage.edit.status }" styleClass="commonSelectBox">
							<f:selectItems value="#{existSystemUserStatus.items}"/>
							<f:ajax event="valueChange" execute="@this" render="@this"></f:ajax>
						</h:selectOneMenu>
						<h:outputLabel value="#{message['system.user.level.display'] }：" styleClass="normallabel"></h:outputLabel>
						<h:selectOneMenu value="#{manageSystemUserPage.edit.level }" styleClass="commonSelectBox">
							<f:selectItems value="#{existSystemUserIdentity.items}"/>
							<f:ajax event="valueChange" execute="@this" render="@this"></f:ajax>
						</h:selectOneMenu>
						<h:outputLabel value="#{message['system.user.orgid.display'] }：" styleClass="normallabel"></h:outputLabel>
						<h:selectOneMenu value="#{manageSystemUserPage.edit.orgId }" styleClass="commonSelectBox">
							<f:selectItem itemLabel="Please select" itemValue="0"/>
							<f:selectItems value="#{existOrganizationListBox.items}"/>
							<f:ajax event="valueChange" execute="@this" render="@this"></f:ajax>
						</h:selectOneMenu>
						<h:outputLabel value=""></h:outputLabel>
						<h:panelGroup>
							<a4j:commandLink action="#{manageSystemUserPage.updateAction}" value="" event="click" execute="@this" oncomplete="javascript:refreshPageAction();" rendered="#{'EDIT' eq manageSystemUserPage.action }" styleClass="btn"><f:verbatim><span>#{message['button.update.display'] }</span></f:verbatim></a4j:commandLink>
							<a4j:commandLink action="#{manageSystemUserPage.saveAction}" value="" event="click" execute="@this" oncomplete="javascript:refreshPageAction();" rendered="#{'NEW' eq manageSystemUserPage.action }" styleClass="btn"><f:verbatim><span>#{message['button.save.display'] }</span></f:verbatim></a4j:commandLink>
						</h:panelGroup>
						<f:facet name="footer">
							<util:messages errorMessages="#{manageSystemUserPage.errorMessages}"></util:messages>
						</f:facet>
					</h:panelGrid>
					<a4j:jsFunction name="refreshPageAction" action="#{manageSystemUserPage.refreshPageAction }" render="mainManageSystemUserPanel pageDataPanel"></a4j:jsFunction>
				</a4j:outputPanel>
				<a4j:outputPanel id="userRolePanel">
					<rich:popupPanel id="popup" modal="true" resizeable="true" height="500" width="200" onmaskclick="#{rich:component('popup')}.hide()">
				        <f:facet name="header">
				            <h:outputLabel value="#{message['user.role.allocate.display']}" styleClass="normallabel"/>
				        </f:facet>
				        <f:facet name="controls">
				            <h:outputLink value="#" onclick="#{rich:component('popup')}.hide(); return false;">
				                #{message['operate.close.display']}
				            </h:outputLink>
				        </f:facet>
				        <rich:panel>
					        <h:outputLabel value="#{message['system.user.loginname.display'] }:#{manageSystemUserPage.currentLoginName}" styleClass="normallabel"></h:outputLabel>
					        <h:selectManyCheckbox id="checkRoles" value="#{manageSystemUserPage.roles}" layout="pageDirection" styleClass="checkboxtable">
	                        	<f:selectItems value="#{manageSystemUserPage.allRoles}"/>
	                     	</h:selectManyCheckbox>
	                     	<h:panelGroup>
	                     		<a4j:commandLink value="" event="click" execute="@form" onclick="allocateUserRoleClick();" oncomplete="#{rich:component('popup')}.hide(); return false;" styleClass="btn"><f:verbatim><span>#{message['button.save.display'] }</span></f:verbatim></a4j:commandLink>
	                     		<a4j:commandLink value="" event="click" execute="@form" onclick="#{rich:component('popup')}.hide(); return false;" styleClass="btn"><f:verbatim><span>#{message['button.goback.display'] }</span></f:verbatim></a4j:commandLink>
	                     	</h:panelGroup>
	                     	<script type="text/javascript">
								function allocateUserRoleClick() {
									var str=""; 
						            $("input[name='checkRoles']").each(function(){ 
						                  if(this.checked) str+=$(this).val()+",";             
						            })
						            allocateUserRole(str);
						        }
						    </script>
						    <a4j:jsFunction name="allocateUserRole" action="#{manageSystemUserPage.allocateUserRoleAction }">
						    	<f:param name="rolesStr"></f:param>
						    </a4j:jsFunction>
                     	</rich:panel>
				    </rich:popupPanel>
			    </a4j:outputPanel>
			</div>
         </h:form>
         <div style="clear:both;float:none" />
	</ui:define>
</ui:composition>
</html>

